<template>
    <div class="sideBar-shell">
        <a href="#" class="box">
            <i class="iconfont icon-zhuye"></i>
            <span>主页</span>
        </a>
        <a href="#" class="box">
            <i class="iconfont icon-wp-sj"></i>
            <span>文档库</span>
        </a>
        <a href="#" class="box">
            <i class="iconfont icon-denglu"></i>
            <span>登录</span>
        </a>
        <a href="#" class="box">
            <i class="iconfont icon-shezhi-xue"></i>
            <span>设置</span>
        </a>
        <a href="#" class="box">
            <i class="iconfont icon-dashang"></i>
            <span>打赏</span>
        </a>
    </div>
</template>

<script setup>
import "@/assets/iconfont.css"
</script>


<style scoped>
/* 清除默认样式 */
* {
    padding: 0;
    margin: 0;
    text-decoration: none;
}

.sideBar-shell {
    width: 85px;
    height: 100vh;
    display: flex;
    align-content: flex-start;
    flex-direction: column;
    background-color: rgb(255, 230, 236);
    border-radius: 7px;
    transition: .3s;
    overflow: hidden;
}

.box {
    display: block;
    position: relative;
    height: 10%;
    width: 80%;
    margin: 9px;
    border-radius: 5px;
    transition: .3s;
    color: rgb(62, 61, 61);
}

.box i {
    font-size: 50px;
    position: absolute;
    top: 50%;
    left: 5px;
    /* 使用 transform 属性进行垂直居中 */
    transform: translateY(-50%);
}

/* .box:nth-child(1)::before,
.box:nth-child(5)::before {
    content: '';
    display: block;
    width: 100%;
    height: 2px;
    background-color: rgb(55, 65, 81);
    position: absolute;
    bottom: -10px;
} */

.box span {
    position: absolute;
    top: 50%;
    left: 65%;
    /* 使用 transform 属性进行水平垂直居中 */
    transform: translate(-50%, -50%);
    font: 500 20px '';
    opacity: 0;
    transition: .1s;
}

.sideBar-shell:hover {
    width: 230px;
}

.box:hover {
    background-color: rgb(45, 74, 123);
    color: #fff;
}

.sideBar-shell:hover span {
    opacity: 1;
}
</style>
